<?php
class Ofx_Config 
{
	const KEY = 'Ofx_Config_';
	
	/**
	 * Get application config object
	 * 
	 * @return Zend_Config
	 */
	public static function getConfig() 
	{
		$host = $_SERVER['SERVER_NAME'];
		$host = (substr($host, 0, 3) == 'www') ? substr($host, 4) : $host;
		
		$key = self::KEY.$host;
		
		if (!Zend_Registry::isRegistered($key)) {
			$config = new Zend_Config_Ini(OFX_APP_DIR . '/configs/Application.ini', APPLICATION_ENV);
			Zend_Registry::set($key, $config);
		}
		
		return Zend_Registry::get($key);
	}
	
}